import request from '@/config/axios'

// 获得地区树
export const getAreaTree = async () => {
  return await request.get({ url: '/system/area/tree' })
}
// 启用地区
export const startUsing = async (data:Object) => {
  return await request.post({ url: '/system/area/start-using', data } )
}

// 停用地区
export const stopUsing = async (id) => {
  return await request.post({ url: `/system/area/stop-using?id=`+ id } )
}

// 获得 IP 对应的地区名
export const getAreaByIp = async (ip: string) => {
  return await request.get({ url: '/system/area/get-by-ip?ip=' + ip })
}
